package com.laizhenghua.demo.controller;

import com.laizhenghua.demo.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Description
 * @Author laizhenghua
 * @Date 2023/6/3 09:04
 **/
@RestController
public class HelloController {
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    @GetMapping("/hello")
    public R hello() {
        redisTemplate.opsForValue().set("name", "alex");
        return R.success(redisTemplate.opsForValue().get("name"));
    }
}
